package com.cusc.module_apply.mvvm.model;

import android.app.Application;

import com.cusc.lib_api.RetrofitManager;
import com.cusc.lib_api.bean.RespList;
import com.cusc.lib_api.bean.dic.DircBean;
import com.cusc.lib_api.config.API;
import com.cusc.lib_api.http.RxAdapter;
import com.cusc.lib_api.services.DictServices;
import com.tcgroup.phone.base_core.framework.mvvm.netregister.BaseNetRegister;

import java.util.ArrayList;

import io.reactivex.Observable;

/**
 * 作者: wangfei
 * 创建时期: 2020/3/28.
 * 包名: com.cusc.module_apply.mvvm.model
 * 类名: OSAndroidMvvm
 */
public class ApplyMainNetRegister extends BaseNetRegister {

    DictServices mDictServices;

    public ApplyMainNetRegister(Application mApplication) {
        super(mApplication);
        mDictServices = RetrofitManager.getInstance().getDicServices();
    }

    /**
     * 调度状态
     * @return
     */
   public Observable<RespList<ArrayList<DircBean>>> getDictToDispatchStatues(){
       return mDictServices.getDircQuery(API.Dispatch_Status)
       .compose(RxAdapter.schedulersTransformer())
       .compose(RxAdapter.exceptionTransformer());
   }

    /**
     * 申请状态 数组 0:未提交 1:提交失败 5:审批中 9:已驳回 10:已撤销 11:审批通过 15:已作废
     * @return
     */
    public Observable<RespList<ArrayList<DircBean>>> getDictToApplyStatues(){
        return mDictServices.getDircQuery(API.Apply_Status)
                .compose(RxAdapter.schedulersTransformer())
                .compose(RxAdapter.exceptionTransformer());
    }

}
